home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 September
/
Macworld (1997-09).dmg
/
Shareware World
/
Utilities
/
Text Processing
/
Alpha
/
Help
/
Adding and Removing Modes
next >
Wrap
Text File
|
1996-07-19
|
2KB
|
56 lines
Adding a New Mode or Menu to Alpha
These instructions pertain to all versions of Alpha greater than or equal
to 6.2b6.
To add a mode to Alpha, a file ending w/ 'Mode.tcl' must be created and
placed in the ":Tcl:modes" directory.
The structure of this file is *very* important. Alpha will automatically
load *at startup* every such file. The file should begin w/ a construct of
the following form:
if {$startingUp} {
addMode Perl dummyPerl {*.pl *.ph *.pm} perlMenu
addMenu perlMenu
return
}
Alpha sets 'startingUp' while loading the mode files at startup. All five
of these lines are important.
'addMode <mode> <dummyProc> <suffixes> <menus>' defines a new mode. When
trying to switch to the Perl mode, Alpha will attempt to execute the
function 'dummyPerl'. The suffixes allow Alpha to automatically determine
the correct mode of a newly opened file.
'addMenu <mname>' defines a new menu, which can be used in any mode.
'mname' must actually be a variable which contains (will contain) the
real menu name, i.e. perlMenu is actually a variable that is defined in
other perl files to be "•132".
Always "Rebuild Tcl Indices" from the Tcl menu after adding
or deleting files! Then restart.
Other functions of note for mode creators:
'newModeVar <mode> <varname> <initial value> <boolean>' - Creates new
per-mode variables that are saved across restarts.
'regModeKeywords' - See other docs.
The 'dummyProc' array is now ignored.
===============================================================================
The 'Deconstruct…' menu item under Config allows modes and
menus to be removed from Alpha. See here.
===============================================================================